namespace UniversalAdminSystem.Domian.FileStorage.ValueObjects;

public record FileSize
{
    public long Value { get; }
    public const long MaxSize = 50 * 1024 * 1024; // 50MB
    private FileSize(long value)
    {
        if (value < 0)
            throw new ArgumentException("文件大小不能为负数");
        if (value > MaxSize)
            throw new ArgumentException($"文件大小不能超过{MaxSize / 1024 / 1024}MB");
        Value = value;
    }
    public static FileSize Create(long value) => new(value);
    public static implicit operator long(FileSize size) => size.Value;
} 